'use strict'
app.service('userService', ['$q','utilService','$cookies', function ($q,utilService,$cookies) {
    var _this_ = this;
    _this_.updateUserIdentity = function ($scope) {
        var deferred = $q.defer();
        utilService.api({
            url: $scope.app.domain + 'user/identity',
            data: $scope.userVipVO,
            method: 'PUT'
        }).then(function (result) {
            deferred.resolve(result);
        });
        return deferred.promise;
    }

    _this_.getVipName= function ($scope) {
        var deferred = $q.defer();
        utilService.get({
            url:$scope.app.domain + 'vip/find/name'
        }).then(function(response){
            deferred.resolve(response.data);
        },function(e){
            console.error(e);
            deferred.reject("连接服务器出错！");
        })

        return deferred.promise;
    }
}]);